package com.usc.entme;

import java.io.IOException;
import java.io.StringReader;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;

import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

import android.app.Activity;
import android.app.ListActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

public class MoviesDesc extends Activity
{
	
	private String TAG="karanDi";
	private static Context context;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) 
	{
		context = this;
		super.onCreate(savedInstanceState);
		setContentView(R.layout.moviesdesc);

		Bundle moviesdesc = this.getIntent().getExtras();
		String movieTitle = moviesdesc.getString("movieTitle");
		String movieUrl = moviesdesc.getString("movieUrl");
		
		movieUrl = "http://m.imdb.com" + movieUrl;
		
		
		/*Document doc;
		XPathExpression xpath = null;
		
		try 
		{
			doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(movieUrl)));
			xpath = XPathFactory.newInstance().newXPath().compile("//td[text()=\"Description\"]/following-sibling::td[2]");
			String result = (String) xpath.evaluate(doc, XPathConstants.STRING);
		} 
		catch (SAXException e) 
		{
			e.printStackTrace();
		}
		catch (IOException e) 
		{
			e.printStackTrace();
		} 
		catch (ParserConfigurationException e) 
		{
			e.printStackTrace();
		}
		catch (XPathExpressionException e) 
		{
			e.printStackTrace();
		}
		*/
		/*Log.v(TAG, movieTitle);
		Log.v(TAG, movieUrl);*/
		
	}
	
}
